import axios from 'axios'

export function getSession() { //获取session_id
  const url = baseURL + 's=User/verifyInit'
  return axios.post(url, {}, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}

export function sendCaptcha(phone) {//发送短信
  const url = baseURL + 's=User/sendCaptcha'
  return axios.post(url, phone, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}

export function verify(data) { //文字验证
  const url = baseURL + 's=User/check_verify'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}

export function login(data) { //登录
  const url = baseURL + 's=User/login'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}

export function islogin() { // 是否登录
  const url = baseURL + 's=User/islogin'
  return axios.post(url, {
    "phpsid": localStorage.getItem('token'),//session_id
  }, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}
//判断是否是游客
export function isTourist(){
  const url = baseURL + 's=User/is_Tourist'
  return axios.post(url, {
    "phpsid": localStorage.getItem('token'),//session_id
  }, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}
//判断微信号是否绑定手机
export function isMobile(data){
  const url = baseURL+'s=User/is_mobile'
  return axios.post(url,data,{
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res=>{
    return res.data;
  })
}
















